package factory.abstractFactory;

import factory.bean.DriverLicence;
import factory.bean.Vehicle;

public class Main {

    public static void main(String[] args) {

        //交通工具, 产品族工厂生产

        CarAndDriverLicenseFactory carAndDriverLicenseFactory = new CarAndDriverLicenseFactory();
        Vehicle car = carAndDriverLicenseFactory.create();
        car.showInfo();
        DriverLicence driverLicenseByCar = carAndDriverLicenseFactory.getDriverLicense();
        driverLicenseByCar.showLicense();

        System.out.println("=========================");

        TruckAndDriverLicenseFactory truckAndDriverLicenseFactory = new TruckAndDriverLicenseFactory();
        Vehicle truck = truckAndDriverLicenseFactory.create();
        truck.showInfo();
        DriverLicence driverLicenseByTruck = truckAndDriverLicenseFactory.getDriverLicense();
        driverLicenseByTruck.showLicense();

    }
}
